import request from '@/utils/request'

const prefixUrl = 'web/transfer_apply/'

export function save(data) {
  return request({
    url: prefixUrl + 'save',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}

export function saveAndBegin(data) {
  return request({
    url: prefixUrl + 'begin',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

export function getDetail(id) {
  return request({
    url: prefixUrl + 'detail/' + id,
    method: 'get'
  })
}

export function getDetail2(params) {
  return request({
    url: prefixUrl + 'detail',
    method: 'get',
    params: params
  })
}

export function list(params) {
  return request({
    url: prefixUrl + 'list',
    method: 'get',
    params: params
  })
}

export function pass(data) {
  return request({
    url: prefixUrl + 'pass',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

export function returnBack(data) {
  return request({
    url: prefixUrl + 'return_back',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

export function deleteData(id) {
  return request({
    url: prefixUrl + 'delete',
    method: 'delete',
    params: { id: id }
  })
}

export function actualDeleteData(id) {
  return request({
    url: prefixUrl + 'actual_delete',
    method: 'delete',
    params: { id: id }
  })
}
